package cn.com.guage;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LogTest {

	private static Logger logger = LoggerFactory.getLogger(LogTest.class);

	public static void say() {
		logger.error("你好!");
	}

	public static void main(String[] args) {
		// 定义一个任务
		TimerTask timerTask = new TimerTask() {
			@Override
			public void run() {
				logger.info("打印当前时间：" + new Date());
			}
		};
		// 计时器
		Timer timer = new Timer();
		// 开始执行任务 (延迟1000毫秒执行，每3000毫秒执行一次)
		timer.schedule(timerTask, 1000, 3000);
	}
}
